From: Paul Eggert Date: Sun, 6 Feb 2011 03:13:16 +0000 (-0800) Subject: * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~4685^2~53 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=5d9d31af70bd369be67ab0ebfae787ef4cfa8d2b;p=emacs.git * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption. Emacs assumes two's complement elsewhere, but the assumption is easy to remove here, and this suppresses a warning with Sun C 5.8. --- diff --git a/src/ChangeLog b/src/ChangeLog index 96ec00089c6..a109189ff58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2011-02-06 Paul Eggert + * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption. + Emacs assumes two's complement elsewhere, but the assumption is + easy to remove here, and this suppresses a warning with Sun C 5.8. + conform to C89 pointer rules * xterm.c (x_draw_fringe_bitmap, handle_one_xevent, x_bitmap_icon): diff --git a/src/xterm.c b/src/xterm.c index 034df89679c..31f002fa05c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1706,7 +1706,7 @@ x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color) a least-squares matching, which is what X uses for closest color matching with StaticColor visuals. */ int nearest, i; - unsigned long nearest_delta = ~0; + unsigned long nearest_delta = ~ (unsigned long) 0; int ncells; const XColor *cells = x_color_cells (dpy, &ncells);